<!doctype html>
<html>
{include file="head.html"}

<body>
<div class="fullscreen">
  <div class="scroll_content">
    <div class="topfixed">
      <div class="t_left"><a href="/index.php"><i class="back"></i></a></div>
      <div class="t_main">我要开店</div>
    </div>
  </div>
  <div class="paddingheight"></div>
  <div class="comblock">
  <form method="post" id="form" action="/index.php?m=shop_apply&a=save&ajax=1">
     
    <input type="hidden" name="shopid" value="{$data.shopid}" >
    <div class="project_add_box">
      <table class="table" >
        <tr>
          <th>姓名：</th>
          <td><input type="text" name="nickname" id="nickname" class="inp" value="{$data.nickname}" ></td>
        </tr>
        <tr>
          <th>电话：</th>
          <td><input type="text" name="telephone" id="telephone" class="inp" value="{$data.telephone}" ></td>
        </tr>
        <tr>
          <th>QQ：</th>
          <td><input type="text" name="qq" id="qq" class="inp" value="{$data.qq}" ></td>
        </tr>
        <tr>
          <td colspan="2" ><div style="height:1px; background-color:#aaa; width:100%;"></div></td>
        </tr>
        <tr>
          <th>店名：</th>
          <td><input type="text" name="shopname" id="shopname" class="inp" value="{$data.shopname}" ></td>
        </tr>
        <tr>
          <th>LOGO：</th>
          <td><div class="uploadbox"> <a href="javascript:;" class="upload2">
              <input type="file" name="upimg" id="upimg" style="width:30px;height:30px;font-size:30px;opacity:0;">
              </a>
              <input type="hidden" name="logo" value="{$data.logo}" id="imgurl">
              <span id="imgShow"> {if $data.logo} <img src="{$data.logo|images_site}.100x100.jpg"> {/if} </span> </div></td>
        </tr>
        <tr style="">
          <th  >经营类型：</th>
          <td ><select name="catid" class="sel">
              <option value="0">请选择</option>
              
              
                
    {foreach item=c from=$cat_list}
                
                
              
              <option value="{$c.catid}" {if $data.catid eq $c.catid} selected="selected"{/if}>{$c.cname}</option>
              
              
                
                {foreach item=c_2 from=$c.child}
                	
                
              
              <option value="{$c_2.catid}" {if $data.catid eq $c_2.catid} selected="selected"{/if} class="o_c_2">|__{$c_2.cname}</option>
              
              
                
                    {foreach item=c_3 from=$c_2.child}
                    
                
              
              <option value="{$c_3.catid}" {if $data.catid eq $c_3.catid} selected="selected"{/if} class="o_c_3"> |____{$c_3.cname}</option>
              
              
                
                    {/foreach}
                {/foreach}
                {/foreach}
    
              
            
            </select></td>
        </tr>
        <tr >
          <th>店铺地址：</th>
          <td><input type="text" name="address" id="address" class="inp" value="{$data.address}" >
             </td>
        </tr>
        <tr style="">
          <th>店铺说明：</th>
          <td><textarea type="text" name="info" id="info" class="area" >{$data.info}</textarea></td>
        </tr>
       
      </table>
      <a href="javascript:;" id="post-submit" class="cart_change_btn">提交申请</a>
    </div>
  </form>
  </div>
</div>
</div>
{include file="footer.html"}
<script src="/plugin/skyweb/lrz.mobile.min.js"></script>
<script language="javascript" src="/plugin/My97DatePicker/WdatePicker.js"></script>
  
<script>
$(function(){
	var input = document.querySelector('#upimg');

input.onchange = function () {
    // 也可以传入图片路径：lrz('../demo.jpg', ...
	$("#uploading").show();
    lrz(this.files[0],{width:1024}, function (results) {
      // 你需要的数据都在这里，可以以字符串的形式传送base64给服务端转存为图片。
      console.log(results);
	  $.post("/index.php?m=upload&a=base64",{content:results.base64},function(data){
		  $("#imgShow").html('<img src="'+data.imgurl+'.100x100.jpg" align="center">');
		  $("#imgurl").val(data.file); 
		   $("#uploading").hide();
	  },"json");
	  
	 
    });
}
	$("#post-submit").on("click",function(){
		$.post($("#form").attr("action"),$("#form").serialize(),function(data){
	
			if(data.error=0){
				skyToast("发布成功");
				 
			}else{
				skyToast(data.message);
			}
		},"json");
	});
});
</script>
</body>
</html>
